﻿using Factory;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OOPA_opdracht.Model
{
    public abstract class MainNode : ICloneable, IGetKey<String>
    {
        protected string nodeName;
        protected List<MainNode> nextNodes;
        protected Inputs firstInput;
        protected Inputs secondInput;
        protected Inputs output;

        protected MainNode()
        {
            nextNodes = new List<MainNode>();
        }

        public static MainNode create(String sNaam)
        {
            return FactoryMethod<String, MainNode>.create(sNaam);
        }

        public Inputs getOutput() { return output; }
        public abstract void setInput(Inputs input);
        public abstract void setOutput();

        public abstract String getKey();
        public abstract object Clone();
        public abstract void show();

        public void setName(string nodeName) { this.nodeName = nodeName; }
        public string getName() { return nodeName; }
        public void addNextNode(MainNode node)
        {
            if (!nextNodes.Contains(node) && node != null)
                nextNodes.Add(node);
            else
                Console.WriteLine("Node already exists in Next Nodes...");
        }
    }
}
